import request from '@/utils/request'

/**
 * 根据类型查询
 * @param {Object} array
 */
export function dataDictTypes(array) {
  return request({
    url: '/anony/dictdata/searchByDictTypes?dictTypes='+ array,
    method: 'get'
  })
}

/**
 * 根据类型查询
 * @param {Object} array
 */
export function dataApi(params) {
  return request({
    url: '/api/dictdata/data',
    method: 'get',
    params
  })
}

/**
 * 根据主键查询
 * @param {Object} id
 */
export function findByIdApi(id) {
  return request({
    url: '/api/dictdata/'+id,
    method: 'get'
  })
}

/**新增数据
 * @param {Object} data
 */
export function addApi(data){
  return request({
    url: '/api/dictdata',
    method: 'post',
    data
  })
}

/**修改数据
 * @param {Object} data
 */
export function updateApi(data){
  return request({
    url:  '/api/dictdata',
    method: 'put',
    data
  })
}

/**
 * 更改状态
 * @param {Object} data
 */
export function changeStatusApi(data){
   return request({
     url: '/api/dictdata/change/status',
     method: 'put',
     data
   })
}
